package com.greensam.pixelengine.repository;

import com.greensam.pixelengine.pojo.entity.RolePo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.querydsl.QuerydslPredicateExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

/**
 * @author Macro_Ray
 * @since 2025/6/19 15:08
 */
@Repository
public interface RoleRepository extends JpaRepository<RolePo, Long>, QuerydslPredicateExecutor<RolePo> {

    Optional<RolePo> findByCodeAndDelete(String code, Boolean delete);

    Optional<RolePo> findByIdAndDelete(Long id, Boolean delete);

    List<RolePo> findAllByDelete(Boolean delete);
}
